//
//  ClosuresViewController.swift
//  SwiftTest
//
//  Created by midea on 16/3/14.
//  Copyright © 2016年 Vincent. All rights reserved.
//

import Foundation
import UIKit

class ClosuresViewController : BaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.titles = ["statement"]
        self.tableView?.reloadData()
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        super.tableView(tableView, didSelectRowAt: indexPath)
        
        switch indexPath.row{
        case 0:
            statementA()
        default:
            print("no more methods")
        }
    }
    
    fileprivate func statementA() {
        let string1 = {
            (stringA,stringB) in return stringA+stringB
        }("hello","world")
        print(string1)
        
        let total = {
            $0+$1
        }(1,2)
        print(total)
        
        let string2 = {
            "what is it"
        }()
        print(string2)
    }
}
